#ifndef CAMERA_HPP
#define CAMERA_HPP

#include <QMatrix4x4>
#include <QVector3D>

class Camera {
public:
    Camera(QVector3D position = QVector3D(0.0f, 0.0f, 3.0f),
           QVector3D up = QVector3D(0.0f, 1.0f, 0.0f),
           float yaw = -90.0f, float pitch = 0.0f);
    
    // 获取矩阵
    QMatrix4x4 getViewMatrix();
    QMatrix4x4 getProjectionMatrix(float aspect, float near = 0.1f, float far = 100.0f);
    
    // 移动控制
    void processKeyboard(int key, float deltaTime);
    void processMouseMovement(float xoffset, float yoffset, bool constrainPitch = true);
    void processMouseScroll(float yoffset);
    
    // 属性访问
    QVector3D getPosition() const { return _position; }
    float getFov() const { return _fov; }

private:
    void updateCameraVectors();
    
    // 摄像机属性
    QVector3D _position;
    QVector3D _front;
    QVector3D _up;
    QVector3D _right;
    QVector3D _worldUp;
    
    // 欧拉角
    float _yaw;
    float _pitch;
    
    // 摄像机选项
    float _movementSpeed;
    float _mouseSensitivity;
    float _fov;
};

#endif